import { getUrlParams } from '@/utils'

/**
 * 获取iframe的targetOrigin
 */
export function useIframeTargetOrigin() {
  const getTargetOrigin = (): string => {
    return (
      getUrlParams(window.location.href, 'target_origin') ||
      import.meta.env.VITE_IFRAME_TARGET_ORIGIN
    )
  }

  return {
    getTargetOrigin
  }
}
